/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.diamondsys.embrapa;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Rafael
 */
@Entity
@Table(name = "rh_tb_funcionario",schema="rh")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RhTbFuncionario.findAll", query = "SELECT r FROM RhTbFuncionario r ORDER BY r.nomeFunc ASC"),
    @NamedQuery(name = "RhTbFuncionario.findByCodFunc", query = "SELECT r FROM RhTbFuncionario r WHERE r.codFunc = :codFunc"),
    @NamedQuery(name = "RhTbFuncionario.findByCodLotacao", query = "SELECT r FROM RhTbFuncionario r WHERE r.codLotacao = :codLotacao"),
    @NamedQuery(name = "RhTbFuncionario.findByCodAgrup", query = "SELECT r FROM RhTbFuncionario r WHERE r.codAgrup = :codAgrup"),
    @NamedQuery(name = "RhTbFuncionario.findByCodFuncao", query = "SELECT r FROM RhTbFuncionario r WHERE r.codFuncao = :codFuncao"),
    @NamedQuery(name = "RhTbFuncionario.findByNomeFunc", query = "SELECT r FROM RhTbFuncionario r WHERE r.nomeFunc = :nomeFunc"),
    @NamedQuery(name = "RhTbFuncionario.findByNomeGuerra", query = "SELECT r FROM RhTbFuncionario r WHERE r.nomeGuerra = :nomeGuerra"),
    @NamedQuery(name = "RhTbFuncionario.findByRegProfissNum", query = "SELECT r FROM RhTbFuncionario r WHERE r.regProfissNum = :regProfissNum"),
    @NamedQuery(name = "RhTbFuncionario.findByCpf", query = "SELECT r FROM RhTbFuncionario r WHERE r.cpf = :cpf"),
    @NamedQuery(name = "RhTbFuncionario.findByRgNum", query = "SELECT r FROM RhTbFuncionario r WHERE r.rgNum = :rgNum"),
    @NamedQuery(name = "RhTbFuncionario.findByEmail", query = "SELECT r FROM RhTbFuncionario r WHERE r.email = :email"),
    @NamedQuery(name = "RhTbFuncionario.findByAtivoFunc", query = "SELECT r FROM RhTbFuncionario r WHERE r.ativoFunc = :ativoFunc"),
    @NamedQuery(name = "RhTbFuncionario.findByLotacao", query = "SELECT r FROM RhTbFuncionario r WHERE r.lotacao = :lotacao"),
    @NamedQuery(name = "RhTbFuncionario.findByAgrupFunc", query = "SELECT r FROM RhTbFuncionario r WHERE r.agrupFunc = :agrupFunc"),
    @NamedQuery(name = "RhTbFuncionario.findBySupervisor", query = "SELECT r FROM RhTbFuncionario r WHERE r.supervisor = :supervisor"),
    @NamedQuery(name = "RhTbFuncionario.findByDtDeslig", query = "SELECT r FROM RhTbFuncionario r WHERE r.dtDeslig = :dtDeslig"),
    @NamedQuery(name = "RhTbFuncionario.findByDtAdmiss", query = "SELECT r FROM RhTbFuncionario r WHERE r.dtAdmiss = :dtAdmiss"),
    @NamedQuery(name = "RhTbFuncionario.findByInstrucao", query = "SELECT r FROM RhTbFuncionario r WHERE r.instrucao = :instrucao"),
    @NamedQuery(name = "RhTbFuncionario.findByTipoFunc", query = "SELECT r FROM RhTbFuncionario r WHERE r.tipoFunc = :tipoFunc")})
public class RhTbFuncionario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "cod_func")
    private String codFunc;
    @Column(name = "cod_lotacao")
    private Integer codLotacao;
    @Column(name = "cod_agrup")
    private Integer codAgrup;
    @Column(name = "cod_funcao")
    private Integer codFuncao;
    @Size(max = 50)
    @Column(name = "nome_func")
    private String nomeFunc;
    @Size(max = 20)
    @Column(name = "nome_guerra")
    private String nomeGuerra;
    @Size(max = 20)
    @Column(name = "reg_profiss_num")
    private String regProfissNum;
    @Size(max = 12)
    @Column(name = "cpf")
    private String cpf;
    @Size(max = 17)
    @Column(name = "rg_num")
    private String rgNum;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="E-mail inválido")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 50)
    @Column(name = "email")
    private String email;
    @Column(name = "ativo_func")
    private Character ativoFunc;
    @Column(name = "lotacao")
    private Short lotacao;
    @Column(name = "agrup_func")
    private Short agrupFunc;
    @Size(max = 50)
    @Column(name = "supervisor")
    private String supervisor;
    @Column(name = "dt_deslig")
    @Temporal(TemporalType.DATE)
    private Date dtDeslig;
    @Column(name = "dt_admiss")
    @Temporal(TemporalType.DATE)
    private Date dtAdmiss;
    @Size(max = 150)
    @Column(name = "instrucao")
    private String instrucao;
    @Size(max = 50)
    @Column(name = "tipo_func")
    private String tipoFunc;

    public RhTbFuncionario() {
    }

    public RhTbFuncionario(String codFunc) {
        this.codFunc = codFunc;
    }

    public String getCodFunc() {
        return codFunc;
    }

    public void setCodFunc(String codFunc) {
        this.codFunc = codFunc;
    }

    public Integer getCodLotacao() {
        return codLotacao;
    }

    public void setCodLotacao(Integer codLotacao) {
        this.codLotacao = codLotacao;
    }

    public Integer getCodAgrup() {
        return codAgrup;
    }

    public void setCodAgrup(Integer codAgrup) {
        this.codAgrup = codAgrup;
    }

    public Integer getCodFuncao() {
        return codFuncao;
    }

    public void setCodFuncao(Integer codFuncao) {
        this.codFuncao = codFuncao;
    }

    public String getNomeFunc() {
        return nomeFunc;
    }

    public void setNomeFunc(String nomeFunc) {
        this.nomeFunc = nomeFunc;
    }

    public String getNomeGuerra() {
        return nomeGuerra;
    }

    public void setNomeGuerra(String nomeGuerra) {
        this.nomeGuerra = nomeGuerra;
    }

    public String getRegProfissNum() {
        return regProfissNum;
    }

    public void setRegProfissNum(String regProfissNum) {
        this.regProfissNum = regProfissNum;
    }

    public String getCpf() {
        return cpf;
    }

    public void setCpf(String cpf) {
        this.cpf = cpf;
    }

    public String getRgNum() {
        return rgNum;
    }

    public void setRgNum(String rgNum) {
        this.rgNum = rgNum;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Character getAtivoFunc() {
        return ativoFunc;
    }

    public void setAtivoFunc(Character ativoFunc) {
        this.ativoFunc = ativoFunc;
    }

    public Short getLotacao() {
        return lotacao;
    }

    public void setLotacao(Short lotacao) {
        this.lotacao = lotacao;
    }

    public Short getAgrupFunc() {
        return agrupFunc;
    }

    public void setAgrupFunc(Short agrupFunc) {
        this.agrupFunc = agrupFunc;
    }

    public String getSupervisor() {
        return supervisor;
    }

    public void setSupervisor(String supervisor) {
        this.supervisor = supervisor;
    }

    public Date getDtDeslig() {
        return dtDeslig;
    }

    public void setDtDeslig(Date dtDeslig) {
        this.dtDeslig = dtDeslig;
    }

    public Date getDtAdmiss() {
        return dtAdmiss;
    }

    public void setDtAdmiss(Date dtAdmiss) {
        this.dtAdmiss = dtAdmiss;
    }

    public String getInstrucao() {
        return instrucao;
    }

    public void setInstrucao(String instrucao) {
        this.instrucao = instrucao;
    }

    public String getTipoFunc() {
        return tipoFunc;
    }

    public void setTipoFunc(String tipoFunc) {
        this.tipoFunc = tipoFunc;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codFunc != null ? codFunc.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RhTbFuncionario)) {
            return false;
        }
        RhTbFuncionario other = (RhTbFuncionario) object;
        if ((this.codFunc == null && other.codFunc != null) || (this.codFunc != null && !this.codFunc.equals(other.codFunc))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.diamondsys.embrapa.RhTbFuncionario[ codFunc=" + codFunc + " ]";
    }
    
}
